package com.itboye.shopcar_adapter;

import java.util.ArrayList;

import com.itboye.core.object.SpPublicParams;
import com.itboye.core.utils.SPUtils;
import com.itboye.core.utils.XImageLoader;
import com.itboye.mengwu.R;
import com.itboye.mengwu.data.model.ZengBean;
import com.tencent.mm.a.a;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class MyGuanZhuAdapter extends BaseAdapter{
	ArrayList<ZengBean> list;
	Context context;
	boolean text;
	public  MyGuanZhuAdapter(ArrayList<ZengBean> list,Context context){
		this.list=list;
		this.context=context;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list==null?0:list.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}
	HandViw handViw;
	@SuppressWarnings("unused")
	@Override
	public View getView(int arg0, View ContxtView, ViewGroup arg2) {
		// TODO Auto-generated method stub
		if(ContxtView==null){
			handViw=new HandViw();
			ContxtView=LayoutInflater.from(context).inflate(R.layout.item_myguanzhu,null);
			handViw.TxtName=(TextView) ContxtView.findViewById(R.id.txtName);
			handViw.txtTimeGuanzhu=(TextView) ContxtView.findViewById(R.id.txtTimeGuanzhu);
			handViw.txtGuanzhuUser=(TextView) ContxtView.findViewById(R.id.txtGuanzhuUser);
			handViw.roundImageHead=(ImageView) ContxtView.findViewById(R.id.roundImageHead);
			ContxtView.setTag(handViw);
		}else{
			handViw=(HandViw) ContxtView.getTag();
		}
		handViw.TxtName.setText(list.get(arg0).getNickname());
		handViw.txtTimeGuanzhu.setText(list.get(arg0).getFocus_time());
		handViw.txtGuanzhuUser.setText(list.get(arg0).getIs_focus_back());
		XImageLoader.load(list.get(arg0).getHead(), handViw.roundImageHead);
		
		return ContxtView;
	}
	class HandViw{
		private TextView TxtName;
		private TextView txtGuanzhuUser;
		private TextView txtTimeGuanzhu;
		private ImageView roundImageHead;
	}

}
